package com.liugl.helloworld

enum class SEX { FEMALE, MALE }

//
open class Person() {
    var name = ""
    var age = 0
    var sex = SEX.MALE

    constructor(name: String, age: Int, sex: SEX) : this() {
        this.name = name
        this.age = age
        this.sex = sex
    }

    constructor(name: String) : this() {
        this.name = name
    }

    fun eat(food: String) =
        println("$name eat $food. ${if (sex == SEX.MALE) "He" else "She"} is $age years old.")

}